import 'package:flutter/material.dart';

class HeaderBar extends StatelessWidget {
  final bool statusBarPadding;
  final Widget? leftWidget;
  final Widget? centerWidget;
  final Widget? rightWidget;

  const HeaderBar({
    super.key,
    this.statusBarPadding = true,
    this.leftWidget,
    this.centerWidget,
    this.rightWidget,
  });

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        if (statusBarPadding)
          SizedBox(height: MediaQuery.of(context).padding.top),
        Padding(
          padding: const EdgeInsets.all(8.0),
          child: Row(
            children: [
              leftWidget ?? const SizedBox.shrink(),
              Expanded(child: centerWidget ?? const SizedBox.shrink()),
              rightWidget ?? const SizedBox.shrink(),
            ],
          ),
        ),
      ],
    );
  }
}